﻿using System;
using System.Collections.Generic;

namespace eCommerce.db.DataRespository
{
    public class OrderEntity
    {
        public int OrderId { get; set; }
        public int AdminUserId { get; set; }
        public int CustomerId { get; set; }
        public int StoreId { get; set; }        
        public int Status { get; set; }
        public int LiquidationType { get; set; }
        public decimal TotalValue { get; set; }
        public decimal Discount { get; set; }
        public decimal Freight { get; set; }
        public decimal Percent { get; set; }        
        public string Note { get; set; }
        public DateTime OrderDate { get; set; }
        public DateTime RequiredDate { get; set; }

        public int ItemIndex { get; set; }
        public string ContactName { get; set; }
        public string Mobile { get; set; }
        public string FormatOrderDate { get; set; }
        public string FormatRequiredDate { get; set; }
        public string TotalOrderMoney { get; set; }
        public string OrderStatus { get; set; }        

        private readonly Dictionary<string, object> _extendedProperties = new Dictionary<string, object>();
        public object this[string propertyName]
        {
            get
            {
                return (_extendedProperties.ContainsKey(propertyName) ? _extendedProperties[propertyName] : null);
            }
            set
            {
                if (_extendedProperties.ContainsKey(propertyName))
                {
                    _extendedProperties[propertyName] = value;
                }
                else
                {
                    _extendedProperties.Add(propertyName, value);
                }
            }
        }
    }
}
